- /* sdmcnvsl.cpp by K.Tsuru */
- // function ID = 305 DRADIX, BRADIX
- #ifndef SN_H
- #include "sn.h"
- #endif
- /**************************************************************
- SDouble and SDecimal classes
- It makes a SLong value result=(figure[top],...,figure[last]).
- It is used in DDMult().
- ***************************************************************/
- void SDouble::ConvertToSLong(uint top, uint last, SLong& result) const{
- uint fs = max(top, First()), ls = min(last, Last());
- if( (top >= figure.size()) || (fs > ls) || (top > last) || (First() > last) ){
- //All the elements are zero
- if(result.RawSign()) result.SetZero();
- return;
- }
-
- register uint j;
- result.valloc(last - fs + 1u, 0);
- const fType* srv = this->ReadFigures();
- fType* rv = result.figure.Elements();
- #ifndef NDEBUG
- result.figure[last-fs] = figure(fs);
- result.figure(last-ls);
- result.figure[last-ls] = figure(ls);
- #endif
- for(j = fs; j <= ls; j++) rv[last-j] = srv[j];
- result.SetSign(1);
- result.CheckArray(305); //It gets the figure position.
- }
sdmcnvsl.cpp : last modifiled at 2017/03/13 14:31:57(1,052 bytes)
created at 2017/10/07 10:21:15
The creation time of this html file is 2017/10/07 10:30:03 (Sat Oct 07 10:30:03 2017).